package com.example.mobile2032021606130zlw0416;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private String Name[]={"广东职业技术学院","佛山职业技术学院","深圳职业技术学院","番禺职业技术学院","东莞职业技术学院","珠海职业技术学院",
            "河源职业技术学院", "惠州职业技术学院","梅州职业技术学院","清远职业技术学院"};
    private RecyclerView Relie;
    private List<Wenzi> i=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        Relie = (RecyclerView) findViewById(R.id.Relie);
        for (int x=0;x<Name.length;x++){
            Wenzi lie=new Wenzi();
            lie.setName(Name[x]);
            i.add(lie);
        }
        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);
        shipeqi shipeqi=new shipeqi(this,i);//还要手动穿列表，坑！
        Relie.setLayoutManager(linearLayoutManager);
        Relie.setAdapter(shipeqi);
    }

    private void initView() {
        Relie = (RecyclerView) findViewById(R.id.Relie);
    }
}
 class Wenzi{
    String name;
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}